/**
 * 
 */
package ao.com.bna.beans;

import java.io.Serializable;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * @author hmaurei
 *
 */
@Entity
@Table(name="TIPOMOEDA")
public class TipoMoeda  implements Serializable{
	

		private static final long serialVersionUID = 1L;

		@Id
		@SequenceGenerator(name="ID_TIPOMOEDA_GENERATOR", sequenceName="TIPOMOEDA_SEQ", allocationSize=1)
		@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ID_TIPOMOEDA_GENERATOR")
		
		@Column(nullable = false, precision = 6)
		private Long idTipoMoeda;
		
		@Column(length =20)
		private String moeda;
		
		@OneToMany(mappedBy = "tipoMoeda")
	    private Collection<Processo> processoCollection;
		
		

		public Long getIdTipoMoeda() {
			return idTipoMoeda;
		}

		public void setIdTipoMoeda(Long idTipoMoeda) {
			this.idTipoMoeda = idTipoMoeda;
		}

		public String getMoeda() {
			return moeda;
		}

		public void setMoeda(String moeda) {
			this.moeda = moeda;
		}

		
		
		
		public Collection<Processo> getProcessoCollection() {
			return processoCollection;
		}

		public void setProcessoCollection(Collection<Processo> processoCollection) {
			this.processoCollection = processoCollection;
		}

		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime
					* result
					+ ((idTipoMoeda == null) ? 0 : idTipoMoeda.hashCode());
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			TipoMoeda other = (TipoMoeda) obj;
			if (idTipoMoeda == null) {
				if (other.idTipoMoeda != null)
					return false;
			} else if (!idTipoMoeda.equals(other.idTipoMoeda))
				return false;
			return true;
		}

		@Override
		public String toString() {
			return moeda;
		}
		

}
